package com.GA;


/**
 * @Author: Chy
 * @Description:
 * @Date: Created at 15:35 2018/4/11
 */
public class Test {

    public static void main(String[] args) {
//        int[] elements = {5, 3, 2, 6, 3, 1, 8, 7, 1, 2, 4, 1, 6, 2, 3, 4, 5, 2, 3, 2, 6, 1, 1, 8, 7, 1, 2, 4, 1, 2, 2, 3, 4, 5, 2, 3, 2, 6, 1, 1, 8, 7, 1, 2, 4, 1, 1, 2, 3, 4, 5, 2, 3, 2, 6, 1, 1, 8, 7, 1, 2, 4, 7, 1, 2, 3, 4, 5, 2, 3, 5, 6, 1, 1, 8, 7, 1, 2, 4, 1, 1, 2, 3, 4, 5, 2 };
        int[] elements = {442,
                252,
                253,
                254,
                255,
                256,
                257,
                258,
                127,
                128,
                129,
                130,
                131,
                132,
                133,
                134,
                135,
                85,
                84,
                46,
                37,
                38,
                12,
                13,
                14,
                10,
                9,
                8,
                7,
                6,
                5,
                4,
                3};
        int binCapacity = 524;
        int popSize = 100;
        int dominants = 5;
        double domRate = 0.93;
        double mutationRate = 0.1;

        BinPacking.Genetics genetics = new BinPacking.Genetics(popSize, dominants, domRate, mutationRate);
        BinPacking binPacking = new BinPacking(elements, binCapacity, genetics);
        Solution best = binPacking.run(5000);
        System.out.println(" ");
    }
}